package br.com.naybee.service.configuracaofs;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import br.com.naybee.domain.configuracaobs.ConfiguracaoBs;
import br.com.naybee.framework.client.core.FrontServiceController;
import br.com.naybee.framework.client.models.ListModel;
import br.com.naybee.framework.client.models.Model;
import br.com.naybee.framework.client.models.Models;

@Controller
@RequestMapping("configuracaoFs")
public class ConfiguracaoFs extends FrontServiceController {

	@Autowired
	private ConfiguracaoBs configuracaoBs;

	@ResponseBody
	@RequestMapping(value = "registrarConfiguracao", method = RequestMethod.POST)
	public Model registrarConfiguracao(@RequestBody Model model) {
		configuracaoBs.registrarConfiguracao(model);
		return Models.newModel();
	}

	@ResponseBody
	@RequestMapping(value = "listarConfiguracoes", method = RequestMethod.POST)
	public ListModel listarConfiguracoes() {
		return configuracaoBs.listarConfiguracoes();
	}

}
